﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace JewererBasic.Models
{
    public class HistoryStone
    {
        public int IdBill { get; set; }
        public string IdStone { get; set; }
        public string IdCreater { get; set; }
        public string Reciever { get; set; }
        public string ReceivedBag { get; set; }
        public int Numb { get; set; }
        public double Weight { get; set; }
        public DateTime Time { get; set; }
        public string Type { get; set; }
        //public int MaPhieuNhapXuat { get; set; }
        public HistoryStone(STONE_EXPORTBAG se, STONE_EXPORTBAGDETAIL bd)
        {
            IdBill = se.IdExport;
            IdStone = bd.IdStone;
            IdCreater = se.IdCreater;
            Reciever = se.EMPLOYEE.Staff_Id;
            ReceivedBag = se.IdBag;
            Numb = bd.Numb;
            Weight = bd.Weight;
            Type = "ExportBag";
            Time = (DateTime)se.DayMake;
        }

        public HistoryStone(STONE_EXPORTSTAFF se, STONE_EXPORTSTAFFDETAIL ss)
        {
            IdBill = se.IdExport;
            IdStone = ss.IdStone;
            IdCreater = se.IdCreater;
            Reciever = se.EMPLOYEE.Staff_Id;
            ReceivedBag = "";
            Numb = ss.Numb;
            Weight = ss.Weight;
            Type = "ExportStaff";
            Time = (DateTime)se.DayMake;
        }

        public HistoryStone(STONE_IMPORT si, STONE_IMPORT_DETAIL sd)
        {
            IdBill = si.Id;
            IdStone = sd.IdStone;
            IdCreater = si.IdCreater;
            Reciever = "";
            ReceivedBag = "";
            Numb = sd.Numb;
            Weight = sd.Weight;
            Type = "Import";
            Time = (DateTime)si.DayMake;
        }
    }
}